//
// File:	DisplayManager.hpp
// Author:	Thomas TISSOT-DUPONT
// Login:	<thomas.tissotdupont@free.fr>
//
// Create:	26/01/2010 at 07:33:27
// Purpose:	
//
#ifndef DISPLAYMANAGER_HPP
#define DISPLAYMANAGER_HPP

#include <QtCore/QTimer>
#include "IDisplayManager.hpp"
#include "View.hpp"
#include "Window.hpp"
#include "RenderCanvas.hpp"

class DisplayManager : public QObject, public IDisplayManager
{
	Q_OBJECT

public:
							DisplayManager();
							~DisplayManager();

public:
	bool					Start();
	bool					Stop();

public:
	IWindow					*GetWindow() const;
	void					InitWindow(const std::string &windowTitle, int iWidth, int iHeight, bool bFullScreen /* = false */);
	void					DestroyWindow();

public:
	bool					IsActive() const;
	void					SetActive(bool bActive);

public:
	IView					*GetView() const;

public:
	RenderCanvas			*GetRenderCanvas() const;

public:
	void					Draw(const IRenderable &);

private slots:
	void					Render();
	void					onWindowClosed();

private:
	Window					*m_pWindow;
	RenderCanvas			*m_pRenderCanvas;
	QTimer					m_renderTimer;
	View					*m_pView;
};

#endif //!DISPLAYMANAGER_HPP
